const  fs=require("fs")

// 默认覆盖写
// fs.writeFileSync("./txt/1.txt","hello")

// 追加写
// fs.writeFileSync("./txt/1.txt","hello",{flag:"a"}) 

// 如果没文件，会创建新文件
// fs.writeFileSync("./txt/2.txt","hello",{flag:"a"}) 


// no such file or directory, open './txt/a/b/1.txt'
fs.writeFileSync("./txt/a/b/1.txt","hello",{flag:"a"}) 